<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>16进制与rgba颜色转换 && canvas主色调取反色差</title>
</head>
<body>
  <script src="./index.js"></script>
  <!-- 调用方式 -->
  <!-- hexToRgba('#a53eda') // rgba(165,62,218,1)
  rgbaToHex('rgba(165,62,218,1)') // #a53eda

  parseColorString('#a53eda') // {r: 165, g: 62, b: 218, a: 1}
  parseColorString('rgba(165,62,218,0.5)') // {r: 165, g: 62, b: 218, a: 0.5}

  toHexString({r: 165, g: 62, b: 218, a: 0.5}) // #a53eda7f
  toRgbaString({r: 165, g: 62, b: 218, a: 0.5}) // rgba(165,62,218,0.5) -->
</body>
</html>